﻿using System;
using System.Collections.Generic;

namespace ExtendedMvc.Common.EntityFramework {
	public interface IBaseRepository<TEntity> where TEntity : IBaseEntity {

		bool Exists(long id);
		TEntity GetById(long id);

		IEnumerable<TEntity> All();
		IEnumerable<TEntity> Filter(Func<TEntity, bool> predicate);

		long Count(Func<TEntity, bool> predicate = null);

		void Add(TEntity entity);
		void Delete(TEntity entity);

		void Save();
	}
}
